package com.game.majiang.vo;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import javax.sql.rowset.CachedRowSet;

import com.game.majiang.logic.Activity;
import com.game.server.db.SqlHelper;

public class ActivityVo {
	
	
	
	/**
	 * 	获取所有活动
	 * @return
	 */
	public static List<Activity> getAllactivityList() {
		List<Activity> list = new ArrayList<Activity>();
		String sql = "select * from activity";
		CachedRowSet rs = SqlHelper.getResultSet(sql);
		try {
			while (rs.next()) 
			{
				Activity a=new Activity();
				a.setId(rs.getInt("id"));
				a.setName(rs.getString("name"));
				a.setTupianurl(rs.getString("tupianurl"));
				a.setIfkaiqi(rs.getInt("ifkaiqi"));
				list.add(a);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return list;
	}
	
	
	

}
